package cn.ubeta.b2c.common;

import android.os.Bundle;
import android.support.v4.app.Fragment;

import cn.ubeta.b2c.R;
import cn.ubeta.b2c.widget.TitleBar;

/**
 * Created by denny on 2016/10/13.
 */

public abstract class FragmentActivity<T extends Fragment> extends AnalyseActivity {

    protected T mFragment;
    protected TitleBar mTitleBar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState, R.layout.activity_fragment);

        mTitleBar = (TitleBar)findViewById(R.id.title_bar);

        mFragment = newFragmentInstance();
        getSupportFragmentManager().beginTransaction()
                .replace(R.id.fl_fragment, mFragment)
                .commit();
    }

    public abstract T newFragmentInstance();
}
